﻿

using FreeSql.DataAnnotations;
using Newtonsoft.Json;
using System.ComponentModel;

namespace LYR_RPA.models.project
{
    public class Project : INotifyPropertyChanged
    {

        private int id;
        private string _scriptName;
        private string _path;
        private string _updateTime;
        private string _module;

        [Column(IsIdentity = true)]
        public int Id
        {
            get { return id; }
            set
            {
                id = value;
                OnPropertyChanged(nameof(Id));
            }
        }

        [JsonProperty("scriptName")]
        public string ScriptName
        {
            get => _scriptName;
            set
            {
                _scriptName = value;
                OnPropertyChanged(nameof(ScriptName));
            }
        }

        [JsonProperty("path")]
        public string Path
        {
            get => _path;
            set
            {
                _path = value;
                OnPropertyChanged(nameof(Path));
            }
        }

        [JsonProperty("updateTime")]
        public string UpdateTime
        {
            get => _updateTime;
            set
            {
                _updateTime = value;
                OnPropertyChanged(nameof(UpdateTime));
            }
        }
        [JsonProperty("module")]
        public string Module
        {
            get => _module;
            set
            {
                _module = value;
                OnPropertyChanged(nameof(Module));
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(string propertyName)
        {
            PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
        }
    }

}
